package stream;


public class Map {
    public static void main(String[] args) {
        // 需求：把字符串中的字母全部转化为大写
        Student.getStudents().stream()
                .filter(student -> student.getName().equals("lucy"))
                .map(student -> student.getName().toUpperCase())
                .forEach(System.out::println);
        System.out.println("======================");
        // 需求：获得集合中所有学生的名字
        Student.getStudents().stream()
                .map(Student::getName)
                .forEach(System.out::println);
        // 需求：获得集合中性别为男的学生名字
        System.out.println("=========================");
        Student.getStudents().stream()
                .filter(student -> student.getGen().equals("男"))
                .map(Student::getName)
                .forEach(System.out::println);
    }
}
